package com.nanhai.buddhist.college.module.collegebase.dal.mysql.accommodationfloor;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.collegebase.dal.dataobject.accommodationfloor.AccommodationFloorDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.collegebase.controller.admin.accommodationfloor.vo.*;

/**
 * 楼层 Mapper
 *
 * @author AKai
 */
@Mapper
public interface AccommodationFloorMapper extends BaseMapperX<AccommodationFloorDO> {

    default PageResult<AccommodationFloorDO> selectPage(AccommodationFloorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AccommodationFloorDO>()
                .eqIfPresent(AccommodationFloorDO::getBuildingId, reqVO.getBuildingId())
                .orderByDesc(AccommodationFloorDO::getCreateTime));
    }

    default List<AccommodationFloorDO> selectList(AccommodationFloorExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<AccommodationFloorDO>()
                .eqIfPresent(AccommodationFloorDO::getBuildingId, reqVO.getBuildingId())
                .orderByDesc(AccommodationFloorDO::getCreateTime));
    }

}
